﻿using Microsoft.Ccr.Core;
using System.Collections.Generic;

namespace CcrFlows.Core
{
    public delegate void SeqHandler<TIn, TOut>(TIn input, Port<TOut> output);
    public delegate IEnumerator<TOut> SeqIteratorHandler<TIn, TOut>(TIn input);

    public delegate void ForkHandler<TIn, TOut0, TOut1>(TIn input, Port<TOut0> output0, Port<TOut1> output1);
    public delegate void JoinHandler<TIn0, TIn1, TOut>(TIn0 input0, TIn1 input1, Port<TOut> output);

    public static class FlowHandlers
    {
        public static SeqHandler<TIn, TIn> Copy<TIn>()
        {
            return (e, pe) => pe.Post(e);
        }
    }

}
